using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Yoozoo.UI;
public class CanvasBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<CanvasBinder.AttributeType, LinkerValueState> AttributeValueDic = new Dictionary<CanvasBinder.AttributeType, LinkerValueState>
    {
        {CanvasBinder.AttributeType.scaleFactor, LinkerValueState.Single},
        {CanvasBinder.AttributeType.referencePixelsPerUnit, LinkerValueState.Single},
        {CanvasBinder.AttributeType.overridePixelPerfect, LinkerValueState.Boolean},
        {CanvasBinder.AttributeType.pixelPerfect, LinkerValueState.Boolean},
        {CanvasBinder.AttributeType.planeDistance, LinkerValueState.Single},
        {CanvasBinder.AttributeType.overrideSorting, LinkerValueState.Boolean},
        {CanvasBinder.AttributeType.sortingOrder, LinkerValueState.Int32},
        {CanvasBinder.AttributeType.targetDisplay, LinkerValueState.Int32},
        {CanvasBinder.AttributeType.sortingLayerID, LinkerValueState.Int32},
        {CanvasBinder.AttributeType.sortingLayerName, LinkerValueState.String},
        {CanvasBinder.AttributeType.normalizedSortingGridSize, LinkerValueState.Single},
        {CanvasBinder.AttributeType.enabled, LinkerValueState.Boolean},
    };
    public CanvasBinderTreeItem() : base(typeof(CanvasBinder))
    {
    }
    
    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (CanvasBinder.AttributeType binderType in Enum.GetValues(typeof(CanvasBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(), binderType.ToString(), (int)AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}